<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                <option value="1" {if condition="$row['type'] eq 1"}selected="true"{/if}>视频</option>
                <option value="2" {if condition="$row['type'] eq 2"}selected="true"{/if}>图文</option>
                <option value="3" {if condition="$row['type'] eq 3"}selected="true"{/if}>音频</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('标题')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control"  name="row[title]" value="{$row['title']}"/>
        </div>
    </div>

    <div class="form-group" id="audio_div" {if condition="$row['type'] neq 3"}style="display: none"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('选择音频')}:</label>
        <div class="col-xs-12 col-sm-8" >
            <div class="input-group">
                <input id="c-audio_title" class="form-control" size="50" name="row[audio_title]"  value="{$row['media_title']}" readonly="readonly" type="text">
                <input id="c-audio_id" class="form-control" size="50" name="row[audio_id]"  value="{$row['media_id']}"  type="hidden">
                <div class="input-group-addon no-border no-padding">
                    <button type="button" id="select-audio" class="btn btn-danger" ><i class="fa fa-upload"></i> {:__('选择音频文件')}</button>
                </div>
                <span class="msg-box n-right" for="c-note"></span>
            </div>
        </div>
    </div>

    <div class="form-group" id="video_div" {if condition="$row['type'] neq 1"}style="display: none"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('选择视频')}:</label>
        <div class="col-xs-12 col-sm-8" >
            <div class="input-group">
                <input id="c-video_title" class="form-control" size="50" name="row[video_name]" readonly="readonly" value="{$row['media_title']}" type="text">
                <input id="c-video_id" class="form-control" size="50" name="row[video_id]"  type="hidden" value="{$row['media_id']}">
                <input id="c-video_type" class="form-control" size="50" name="row[video_type]"  type="hidden" value="{$row['type']==3?'audio':'video'}">
                <div class="input-group-addon no-border no-padding">
                    <button type="button" id="select-video" class="btn btn-danger" ><i class="fa fa-upload"></i> {:__('选择视频文件')}</button>
                </div>

            </div>

        </div>
    </div>

    <div id="content_div" {if condition="$row['type'] neq 2"}style="display: none"{/if}>

        <div class="form-group" >
            <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row['content']}</textarea>
            </div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
